import { defineStore } from 'pinia'
type ImageDomain = {
  adv_cover: string
  article_cover: string
  atlas_content_cover: string
  atlas_cover: string
  movie_cover: string
  person_cover: string
}
interface ISystemSource {
  imageDomain: ImageDomain
}
const useCollectManageStore = defineStore({
  id: 'systemStore',
  state: (): ISystemSource => ({
    imageDomain: {
      adv_cover: '',
      article_cover: '',
      atlas_content_cover: '',
      atlas_cover: '',
      movie_cover: '',
      person_cover: ''
    }
  }),
  getters: {},
  actions: {
    setImageDomain(domain: ImageDomain) {
      this.imageDomain = domain
    }
  },
  persist: {
    enabled: true,
    strategies: [
      {
        key: 'systemStore', // 默认key是上面store的id，可自定义key
        storage: sessionStorage, // 默认是sessionStorage会话存储，可以设置为localStorage本地长存储
        paths: ['imageDomain']
      }
    ]
  }
})
export default useCollectManageStore
